//let str = 'aslxjkgakfakerkxlkfeikakdck'
(function getMax(str = 'aslxjkgakfakerkxlkfeikakdck') {
  let obj = {}
  Array.from(str).forEach((item) => {
    if (obj[item]) {
      obj[item]++
    } else {
      obj[item] = 1
    }
  })

  let max = 0, letter = ''
  for (let item in obj) {
    if (obj[item] > max) {
      max = obj[item]
      letter = item
    }
  }
  console.log(max, letter)
})()
